import Vue from 'vue'
import Router from 'vue-router'
import TransactionList from '@/views/TransactionList.vue'
import TransactionUpload from '@/views/TransactionUpload.vue'
import TransactionAdd from '@/views/TransactionAdd.vue'
import TransactionEdit from '@/views/TransactionEdit.vue'
import TransactionPartnerStats from '@/views/TransactionPartnerStats.vue'

Vue.use(Router)

const routes = [
  {
    path: '/',
    redirect: '/transaction-list'
  },
  {
    path: '/transaction-list',
    name: 'TransactionList',
    component: TransactionList
  },
  {
    path: '/transaction-upload',
    name: 'TransactionUpload',
    component: TransactionUpload
  },
  {
    path: '/transaction-add',
    name: 'TransactionAdd',
    component: TransactionAdd
  },
  {
    path: '/transaction-edit/:id',
    name: 'TransactionEdit',
    component: TransactionEdit
  },
  {
    path: '/transaction-partner-stats',
    name: 'TransactionPartnerStats',
    component: TransactionPartnerStats
  }
]

const router = new Router({
  mode: 'history',
  base: import.meta.env.BASE_URL || '/',
  routes
})

export default router